/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef SMART_SERVE_PLUGIN_TYPES_H
#define SMART_SERVE_PLUGIN_TYPES_H

namespace OHOS {
namespace SmartServe {

enum class ApplyResult {
    SUCCESSFUL, // 资源变更成功
    UNCHANGED,  // 资源变更不成功，但变更错误已修复，资源维持现有状态不变
    FATAL,      // 发生不可恢复错误，需要销毁 Model/Session
};

constexpr const char* str(ApplyResult event)
{
    switch (event) {
        case ApplyResult::SUCCESSFUL:
            return "SUCCESSFUL";
        case ApplyResult::UNCHANGED:
            return "UNCHANGED";
        case ApplyResult::FATAL:
            return "FATAL";
        default:
            return "UNKNOWN";
    }
}

enum class EvalResult {
    FINISHED, // 任务结束（包括成功、失败），无需进一步处理
    CONTINUE, // 任务单步完成，仍需要继续处理该任务
    FATAL,    // 发生不可恢复错误，需要销毁 Session
};

constexpr const char* str(EvalResult event)
{
    switch (event) {
        case EvalResult::FINISHED:
            return "FINISHED";
        case EvalResult::CONTINUE:
            return "CONTINUE";
        case EvalResult::FATAL:
            return "FATAL";
        default:
            return "UNKNOWN";
    }
}

} // namespace SmartServe
} // namespace OHOS

#endif // SMART_SERVE_PLUGIN_TYPES_H
